<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
cfc('core')->checklogin();
$return=array();
$fans = pdo_get('jy_h5game_fans',array('fansId'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']));
if($_RQ['op']=='main'){
	$return['list']=array();
	$return['params']['awardstatus']=0;
	$return['post']=array(
		'ausername'=>$fans['ausername'],
		'aphone'=>$fans['tel'],
		'address'=>$fans['address'],
	);
	exi($return);
}
if($_RQ['op']=='list'){
	$params=array('uniacid'=>$_SESSION['uniacid'],'fansID'=>$_SESSION['uid']);
	$params['awardstatus']=intval($_RQ['awardstatus']);
	$return['params']['awardstatus']=intval($_RQ['awardstatus']);
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$list=pdo_getslice('jy_h5game_award',$params,array($pindex,$psize),$total,array(),'','id desc');
	if($list){
		foreach($list as &$item){
			$item['rtitle']=pdo_getcolumn('jy_h5game_reply',array('id'=>$item['rid'],'uniacid'=>$_SESSION['uniacid']),'title');
			$item['createtime']=date('Y/m/d H:i:s',$item['createtime']);
		}
	}
	$return['list']=$list?$list:array();
	exi($return);
}